package com.jec.module.sysconfig.service.configor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Component;

import com.jec.module.sysconfig.dao.PhoneStationRepository;
import com.jec.module.sysconfig.entity.PhoneStation;
import com.jec.module.sysconfig.service.convertor.Convertor;
import com.jec.module.sysconfig.service.convertor.PhoneStationConvertor;

@Component
public class PhoneStationConfigor extends BaseConfigor<PhoneStation> {
	
	@Autowired
	private PhoneStationRepository phoneStationRepository;
	
	@Autowired 
	private PhoneStationConvertor phoneStationConvertor;
	
	public PhoneStationConfigor() {
		logKey = "话务台";
	}

	@Override
	protected JpaRepository<PhoneStation, Integer> getRepository() {
		return phoneStationRepository;
	}
	
	
	@Override
	protected Convertor<PhoneStation> getConvertor() {
		return phoneStationConvertor;
	}

	@Override
	public boolean hasConfigOnNetunit(int netunit) {
		return !phoneStationRepository.findAllByNetunit(netunit).isEmpty();
	}

}
